package pl.perseus.action;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import pl.perseus.model.enums.Week;

import lombok.Getter;
import lombok.Setter;

public class GetWeekDaysAction extends BaseAction {

	@Getter
	@Setter
	Map<String, Object> result;
	
	@Override
	public String execute() {
		result = new HashMap<String, Object>();
		List<Map<String, String>> items = new LinkedList<Map<String, String>>();
		for(Week w : Week.values()){
			Map<String, String> weekMap = new HashMap<String, String>();
			weekMap.put("id", w.getDay());
			weekMap.put("name", w.getDay());
			
			items.add(weekMap);
		}
		
		result.put("identifier", "id");
		result.put("items", items);
		
		return SUCCESS;
	}

}
